import { RouteRecordRaw } from "vue-router";
const routes: RouteRecordRaw[] = [
    // {
    //     path:'/',
    //     redirect:'/search'
    // },
    {
        path: "/",
        component: () => import("../views/index/index.vue"),
        children: [
            {
                path: "home",
                component: () => import("../views/index/home/index.vue"),
                children: [
                    {
                        name: 'SomePage',
                        path: 'somepage',
                        component: () => import('../views/index/home/SomePage/index.vue')
                    }
                ]
            },
            {
                path: "item",
                component: () => import("../views/index/item/index.vue"),
                children:[
                    {
                    path:'catelist',
                    component:()=>import('../views/index/item/cateList/index.vue')
                    },
                    {
                        path:'list',
                        component:()=>import('../views/index/item/list/index.vue')
                    },  
                     {
                        path: '',
                        redirect: '/item/catelist'
                
                    }
                ]
                
            },

            {
                path: "buy",
                component: () => import("../views/index/buy/index.vue"),
            },
            {
                path: "shopCar",
                component: () => import("../views/index/shopCar/index.vue"),
            },
            {
                path: "user",
                component: () => import("../views/index/user/index.vue"),
            },
            {
                path: "/",
                redirect: "/home",
            },
        ],
    },
    {
        path: '/search',
        component: () => import('../views/search/index.vue')
    }, {
        path: '/login',
        component: () => import('../views/login/index.vue'),
    },
    {
        path: "/phoneLogin",
        component: () => import("../views/login/phoneLogin.vue"),
    },
    {
        path: "/register",
        component: () => import("../views/login/register.vue"),
    },
    {
        path: '/register',
        component: () => import('../views/login/register.vue')
    },
    {
        path: "/search",
        component: () => import("../views/search/index.vue"),
    },

]

export default routes;
